ResCopy value of theSource, theTarget, "XFCN", "GetPVolume"
if "OK" is in the result then
ResCopy value of theSource, theTarget, "XCMD", "SetPVolume"
if "OK" is in the result then answer "Installation complete." with "Ok"
else error "SetVolume"
else error "GetVolume"
end if
end mouseUp
on error what
beep
answer "Unable to install " & what & "." with "Cancel"
end error
-- part 2 (field)
-- low flags: 01
-- high flags: 0001
-- rect: left=3 top=67 right=291 bottom=509
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 10
-- style flags: 0
-- line height: 13
-- part name:
-- part 3 (field)
-- low flags: 01
-- high flags: 0004
-- rect: left=116 top=32 right=57 bottom=407
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 6
-- text size: 18
-- style flags: 17408
-- line height: 24
-- part name:
-- part 5 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=476 top=310 right=333 bottom=506
-- title width / last selected line: 0
-- icon id / first selected line: 1014 / 1014
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name:
----- HyperTalk script -----
on mouseUp
go to card id 2857
end mouseUp
-- part contents for card part 2
----- text -----
GetPVolume and SetPVolume are an XFCN and XCMD that allow you to find out and set the volume of the speaker, as stored in the Parameter RAM, within a script. The Parameter RAM is where teh Control Panel gets and sets the speaker volume. There are times when the GetVolume and SetVolume on the previous card are not enough, such as when using the Talk XCMD. By using these routines, you can work with the volume in cases where the others don't work. It is not, however, appropriate to modify the Parameter RAM without thought. Make sure you must use SetPVolume and GetPVolume before you start using them.
The format of the commands are:
SetVolume(<volume>)
and
GetVolume()
Where <volume> is between 0 and 7. The parenthesis are required for GetVolume to be recognized as a XFCN by HyperCard.
These routines where written by Steven Kienle [72330,111] in TML Pascal, source code is included in the StuffIt file with this Stack.